#coding:utf8
from google.appengine.api import users
from django.shortcuts import render_to_response

def request_login_gmail(func):
    def _login_gmail(*args):
        user = users.GetCurrentUser()
        if not user:
            greeting = ("<a href=\"%s\">需要登录Google帐号，点击进行登录</a>." % 
                    users.create_login_url("/"))
     
            return render_to_response('msg.html', {'msg':greeting, 'url':'/'})
        return func(*args)
    return _login_gmail